<?php

namespace app\admin\model;

use think\Model;


class ClothmakingProduct extends Model
{

    

    

    // 表名
    protected $name = 'clothmaking_product';
    
    // 自动写入时间戳字段
    protected $autoWriteTimestamp = 'integer';

    // 定义时间戳字段名
    protected $createTime = 'createtime';
    protected $updateTime = 'updatetime';
    protected $deleteTime = false;

    // 追加属性
    protected $append = [
        'thickness1_text',
        'density1_text',
    ];

    /**
     * 获取厚度1显示文本
     */
    public function getThickness1TextAttr($value, $data)
    {
        return isset($data['thickness1']) ? $data['thickness1'] . ' mm' : '';
    }

    /**
     * 获取密度1显示文本
     */
    public function getDensity1TextAttr($value, $data)
    {
        return isset($data['density1']) ? $data['density1'] . ' kg/m³' : '';
    }
    

    







}
